package org.rguess.patterns.dyproxy;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

public class HelloWorldHandler implements InvocationHandler{
	
	private Object object;
	
	public HelloWorldHandler(Object obj) {
		super();
		this.object = obj;
	}

	@Override
	public Object invoke(Object proxy, Method method, Object[] args)
			throws Throwable {
		Object result = null;
		System.out.println("before");
		result = method.invoke(object, args);
		System.out.println("after");
		return result;
	}

	
}
